package com.jhgsys.internal.workflow.callbackTask;

import com.alibaba.fastjson.JSON;
import com.jhgsys.internal.common.utils.SpringContextUtil;
import com.jhgsys.internal.workflow.callbackTask.base.BaseWorkflowNodeEvent;
import com.jhgsys.internal.workflow.entity.WorkflowInfo;
import com.jhgsys.internal.workflow.service.IWorkflowInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.concurrent.ExecutionException;

/**
 * 测试
 * @author fenghaijun
 */
@Slf4j
@Component("test1")
public class Test1 implements BaseWorkflowNodeEvent {

    /**
     * 任务实现
     */
    @Override
    public void execute(String workflowApplyId) throws ExecutionException {
        //参考
        IWorkflowInfoService workflowInfoService = SpringContextUtil.getBean(IWorkflowInfoService.class);
        WorkflowInfo workflowInfoById = workflowInfoService.findWorkflowInfoById("1");
        log.info(JSON.toJSONString(workflowInfoById));
    }
}
